package com.example.obs.model.domin;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@NoArgsConstructor
public class ObsFile {
    private Integer fileId; //文件id

    private String fileName; //文件名

    private Integer fileState; //文件状态

    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date makeTime;  //创建时间

    private String path;  //文件路径


    private String size; //文件大小

    private String type; //文件类型

    private Integer userId;  //所有者id
    /** 文件/文件夹 默认权限 */
    private Integer permissions;

    public ObsFile(  Integer userId,String fileName) {
        this.fileName = fileName;
        this.path=fileName+"/";
        this.fileState = 1;
        this.userId = userId;
        this.type="文件夹";
    }

}
